package com.godyao.mall.user.api.feign.fallback;

import com.godyao.mall.core.model.ResultCode;
import com.godyao.mall.core.model.ResultMsg;
import com.godyao.mall.user.api.feign.UserFeign;
import com.godyao.mall.user.common.model.SysRole;
import com.godyao.mall.user.common.model.SysUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author godyao
 * @date 2022/4/2
 */
@Slf4j
@Component
public class UserFeignFallback implements UserFeign {
    @Override
    public ResultMsg<SysUser> getByUsername(String username) {
        log.error("User Server Fallback..........");
        return ResultMsg.resultFail(ResultCode.SERVER_FALLBACK.getCode(),ResultCode.SERVER_FALLBACK.getMsg());
    }

    @Override
    public ResultMsg<List<SysRole>> getRolesByUserId(Long userId) {
        log.error("User Server Fallback..........");
        return ResultMsg.resultFail(ResultCode.SERVER_FALLBACK.getCode(),ResultCode.SERVER_FALLBACK.getMsg());
    }

    @Override
    public ResultMsg<SysUser> getByUserId(String userId) {
        log.error("User Server Fallback..........");
        return ResultMsg.resultFail(ResultCode.SERVER_FALLBACK.getCode(),ResultCode.SERVER_FALLBACK.getMsg());
    }

    @Override
    public ResultMsg<List<SysUser>> listByUserId(List<String> userIds) {
        log.error("User Server Fallback..........");
        return ResultMsg.resultFail(ResultCode.SERVER_FALLBACK.getCode(),ResultCode.SERVER_FALLBACK.getMsg());
    }
}


